/*
 * Copyright (C) 2017 Pingan, Inc. All Rights Reserved.
 */

package com.pingan.haofang.searchcloud.index.dto;

import java.util.concurrent.atomic.AtomicLong;

/**
 * 索引构建运行时过程
 * 
 * @author LUYI374
 * @date May 16, 2017
 * @since 1.0.0
 */
public class IndexBuildRunningProgressDTO {

    /**
     * ID
     */
    private Long id;

    /**
     * 抓取成功记录数
     */
    private long fetchSuccessCount;

    /**
     * 抓取总记录数
     */
    private long fetchTotalCount;

    /**
     * 导入成功记录数
     */
    private long importSuccessCount;

    /**
     * 导入总记录数
     */
    private long importTotalCount;

    /**
     * rpc拉取数据耗时
     */
    private AtomicLong rpcCostTime = new AtomicLong(0);

    /**
     * 数据导入到solr / es 耗时
     */
    private AtomicLong dataImportCostTime = new AtomicLong(0);

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public long getFetchSuccessCount() {
        return fetchSuccessCount;
    }

    public void setFetchSuccessCount(long fetchSuccessCount) {
        this.fetchSuccessCount = fetchSuccessCount;
    }

    public long getFetchTotalCount() {
        return fetchTotalCount;
    }

    public void setFetchTotalCount(long fetchTotalCount) {
        this.fetchTotalCount = fetchTotalCount;
    }

    public long getImportSuccessCount() {
        return importSuccessCount;
    }

    public void setImportSuccessCount(long importSuccessCount) {
        this.importSuccessCount = importSuccessCount;
    }

    public long getImportTotalCount() {
        return importTotalCount;
    }

    public void setImportTotalCount(long importTotalCount) {
        this.importTotalCount = importTotalCount;
    }

    public AtomicLong getRpcCostTime() {
        return rpcCostTime;
    }

    public void setRpcCostTime(AtomicLong rpcCostTime) {
        this.rpcCostTime = rpcCostTime;
    }

    public AtomicLong getDataImportCostTime() {
        return dataImportCostTime;
    }

    public void setDataImportCostTime(AtomicLong dataImportCostTime) {
        this.dataImportCostTime = dataImportCostTime;
    }

    @Override
    public String toString() {
        return "IndexBuildRunningProgressDTO{" +
                "id=" + id +
                ", fetchSuccessCount=" + fetchSuccessCount +
                ", fetchTotalCount=" + fetchTotalCount +
                ", importSuccessCount=" + importSuccessCount +
                ", importTotalCount=" + importTotalCount +
                ", rpcCostTime=" + rpcCostTime +
                ", dataImportCostTime=" + dataImportCostTime +
                '}';
    }
}
